package com.lpc.conroller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lpc.beans.Department;
import com.lpc.beans.Msg;
import com.lpc.service.DepartmentService;

/**
 * 作者: 李鹏程
 * 时间：2018年1月28日 下午5:48:55
 * 作用:
 */
@Controller
public class DepartmentController {
	 @Autowired
	 private  DepartmentService departmentService;
	 @ResponseBody
	  @RequestMapping("/depts")
      public Msg getDeparts(){
    	  List<Department> depts = departmentService.getDeparts();
    	  return Msg.success().add("depts", depts);
      }
}
